package com.situ.mall.admin.task;


import com.situ.mall.common.service.IAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;


@Component
public class CleanTask {
    @Autowired
    private IAttachmentService attachmentService;

    //cron表达式 定制一个调度规则
    @Scheduled(cron = "0 0/30 * * * ?")
    public void cleanAttachment(){
        attachmentService.clean();
    }
}
